﻿using Microsoft.AspNetCore.Http;
using NPOI.SS.UserModel;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace slwhTools.ExcelHelper
{
    public interface ISExcelFactory<T>
    {
        /// <summary>
        /// 读取excel文件流
        /// </summary>
        /// <param name="MenmoryStream"></param>
        /// <returns></returns>
        public IEnumerable<T> ReadExcel<T>(MemoryStream? MenmoryStream) where T:new();

        /// <summary>
        /// 读取excel文件
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="file"></param>
        /// <returns></returns>
        public IEnumerable<T> ReadExcelFile<T>(IFormFile file) where T : new();

        /// <summary>
        /// 集合数据内容填充
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="list"></param>
        /// <returns></returns>
        public void ImportExcel<T>(IEnumerable<T> list) where T : new();

        /// <summary>
        /// 导出excel文件流
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="list"></param>
        /// <returns></returns>
        public MemoryStream RStream();

      
    }
}
